<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>系统类型管理</title>
<style type="text/css">
body{
  font-size:12px;	
}

</style>
<load href="__PUBLIC__/Js/jquery.js"/>
<script language="javascript">
function switch_type(type_id,col_id){
	if(type_id==parseInt("{$type_id}")){
	   $("#new_attr_list").html($("#old_attr_list").html());
	   return false;
	}
	//加载对应
	$.ajax({
		type:"GET",
		cache:false,
		async:false,
		dataType:"json",
		data:"type_id="+type_id+"&col_id="+col_id,
		url:"{:U('Admin-Public/ajax_get_attr_list')}",
		success:function(text){
			
			var attr_list = eval(text);
			var html = "";
			
			$.each(attr_list,function(i,n){
				html+="<tr><td>"+n.attr_name+"</td><td><input type='text' name='attr[value]' value='' /></td><td><input type='hidden' name='attr[id]' value='"+n.id+"'/></td></tr>";
			});
			$("#new_attr_list").html(html);
		}
	});
	
  	
}
</script>
</head>

<body>

<table cellpadding="5">
  <tr>
    <td>系统类型:</td>
    <td><select name="select" id="select" onchange="switch_type(this.value,'{$col_id}')">
     <volist name="type_list" id="vo">
     <eq name="vo.id" value="$type_id">
       <option value="{$vo.id}" selected="selected">{$vo.attr_name}</option>
     <else/>
       <option value="{$vo.id}">{$vo.attr_name}</option>
     </eq>
     </volist>
    </select></td>
    <td>请选择所属系统类型，进而完善类型属性</td>
  </tr>
</table>

<table cellpadding="5" id="old_attr_list" style="display:none">
  <volist name="attr_list" id="vo">
  <tr>
    <td>{$vo.attr_name}:</td>
    <td><input type="text" name="attr[value]" value="{$vo.value}" /></td>
    <td><input type="hidden" name="attr[id]" value="{$vo.id}"/></td>
  </tr>
  </volist>
</table>

<table cellpadding="5" id="new_attr_list">
  <volist name="attr_list" id="vo">
  <tr>
    <td>{$vo.attr_name}:</td>
    <td><input type="text" name="attr[value]" value="{$vo.value}" /></td>
    <td><input type="hidden" name="attr[id]" value="{$vo.id}"/></td>
  </tr>
  </volist>
</table>


</body>
</html>
